package com.jic.market.mapper.overlay;

import com.jic.market.entity.overlay.OverlayBaseInfo;

import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * 叠加规则信息表
 *
 * @author : seven
 * @version : v1.0.0
 * @email : 774329481@qq.com
 * @since : 2020-03-20 04:41:52
 */
@Repository
public interface OverlayBaseInfoMapper {

    long insert(OverlayBaseInfo overlayBaseInfo);

    long delete(@Param("overlayId") String overlayId);

    long update(OverlayBaseInfo overlayBaseInfo);

    OverlayBaseInfo queryByPrimaryKey(Long id);

    List<OverlayBaseInfo> query(OverlayBaseInfo overlayBaseInfo);

    List<OverlayBaseInfo> queryPage(@Param("startIndex") int startIndex, @Param("limit") int limit, @Param("overlayBaseInfo") OverlayBaseInfo overlayBaseInfo);

    long queryPageCount(OverlayBaseInfo overlayBaseInfo);

    @Update("update market_overlay_base_info set status=#{status} where overlay_id=#{overlayId} and delete_flag='0'")
    long updateStatus(@Param("overlayId")String overlayId,@Param("status")String status);

    @Select("select * from market_overlay_base_info where overlay_id = #{overlayId} and delete_flag='0'")
    OverlayBaseInfo queryByOverlayId(@Param("overlayId")String overlayId);
}